package com.xxzuibang.day8.构造方法;

public class Test01 {
    public static void main(String[] args) {
        Person1 p=new Person1();
        System.out.println(p.name+" "+p.age);
        Person1 p1= new Person1("xx",18);
        System.out.println(p1.name+" "+p1.age);


    }
}
class Person1{
    String name;
    int age;
    public Person1() {
        this.age=18;
    }

    public Person1(String pName, int pAge) {
        this.name = pName;
        this.age =pAge;
    }
}